import request from '/@/utils/request';

export function btnApi() {
    return {
        createBtn: (data: object) => {
            return request({
                url: '/sys/perm/btn/create',
                method: 'POST',
                data,
            });
        },
        updateBtn: (data: object) => {
            return request({
                url: '/sys/perm/btn/update',
                method: 'PUT',
                data,
            });
        },
        deleteBtn: (id: any) => {
            return request({
                url: `sys/perm/btn/delete/${id}`,
                method: 'DELETE',
            });
        },
        batchDeleteBtn: (data: object) => {
            return request({
                url: '/sys/perm/btn/batchdelete',
                method: 'POST',
                data,
            });
        },
        viewBtn: (id: any) => {
            return request({
                url: `sys/perm/btn/view/${id}`,
                method: 'GET',
            });
        },
        searchBtn: (data: object) => {
            return request({
                url: 'sys/perm/btn/search',
                method: 'POST',
                data,
            });
        },
        all: () => {
            return request({
                url: 'sys/perm/btn/all',
                method: 'GET',
            });
        },

        allTypes: () => {
            return request({
                url: 'sys/perm/btn/all/types',
                method: 'GET',
            })

        }

    };
}
